const mongoose = require('mongoose');

const Schema = new mongoose.Schema({
  username: String, //登录账号
  password: String, //登录密码

  customerName: String, //客户名称
  linkmanName: String, //联系人姓名
  respectfully: String, //尊称
  role: String, //角色
  department: String, //部门职务
  cell: Number, //手机号码
  immobilization: Number, //固定号码
  fax: Number, //传真号码
  email: String, //电子邮箱
  WeChat: String, //微信账号
  qq: String, //QQ号码
  Vesting: String, //归属人员或跟进人员
  clueState: String, //线索状态
  serial: String, //系统编号
  establish: String, //创建人员
  previous: String, //前所属部门
  establishTime: String, //创建时间
  updateTime: String, //更新时间
  followTime: String, //最后跟进时间
  nextTime: String, //下一次跟进时间
  notFollow: String, //未跟进天数
  content: String, //跟进内容
  remind: String, //任务提醒
  remindWay: String, //提醒方式
  id: Number,
  headline: String, //日程标题
  state: String, //日程状态
  status: String, //状态

  //客户LN
  userName: String, //用户名
  bu: String, //部门
  price: String, //价格
  sex: String, //性别
  bir: String, //生日
  emi: String, //邮箱
  tel: String, //电话
  vx: String, //微信
  zuo: String, //座机
  gong: String, //邮编
  ji: String, //籍贯
  school: String, //毕业学校
  bi: String, //毕业时间
  xue: String, //学历
  study: String, //专业
  gongsi: String, //公司
  star: String, //星级
  laseTime: String, //最后登录时间
  type: String, //跟进类型
  khfl: String, //客户分类
  leiAll: String, //全部类型
  lei: String, //客户类型
  types: String, //客户类型
  hang: String, //行业
  xiaTime: String, //生日距离

  //产品列表
  vip: String, //VIP
  price: String, //价格
  productNum: String, //产品编号
  message: String, //备注
  timeType: String, //时间类型
});

const LNClient = new mongoose.Schema({
  contactClass: String, //联系人分类
  leadSource: String, //线索来源
  leadStatus: String, //线索状态
  role: String, //角色
  clientName: String, //客户名称
  contactName: String, //联系人姓名
  contactPhone: String, //联系人电话
  sex: String, //性别
  addressSb: String, //尊称
  email: String, //邮箱
  department: String, //部门职务
  tel: String, //座机
  QQ: String, //QQ
  weChat: String, //微信
  GSpeople: String, //归属人员
  GJpeople: String, //跟进人员
  GJtime: String, //跟进时间
  _id: String, //id
  idCard: String, //编号
  title: String, //标题
  type: String, //类型
  people: String, //人员
  time: String, //时间
  Gtype: String, //跟进类型
  jine: String, //跟进金额
  column: String, //所属栏目
  receiver: String, //接收人员
  status: String, //已读状态
  timeType: String, //时间类型

  name: String,
  contact: String,
  tel: String,
  ascription: String,
  type: String,
  go: String,
  day1: String,
  day2: String,
  day3: String,
  day4: String,
  yue1: String,
  yue2: String,
  yue3: String,
  yue4: String,
  yue5: String,
  yue6: String,
  yue7: String,
  yue8: String,
  yue9: String,
  yue10: String,
  yue11: String,
  yue12: String,
  nums: String,
});

const user = mongoose.model('users', Schema);
const login = mongoose.model('login', Schema);
const salesLead = mongoose.model('salesLead', Schema);
const uapp = mongoose.model('uapp', Schema);
const year = mongoose.model('year', Schema);
const kehu = mongoose.model('kehu', Schema);
const product = mongoose.model('product', Schema);
const kpi = mongoose.model('kpi', Schema);
const client = mongoose.model('client', LNClient);
const ticket = mongoose.model('ticket', LNClient);
const tsb = mongoose.model('tsb', LNClient);
const duishou = mongoose.model('duishou', Schema);
const guanhuai = mongoose.model('guanhuai', Schema);
const qunfa = mongoose.model('qunfa', Schema);
const shangji = mongoose.model('shangji', Schema);
const xiaoxi = mongoose.model('xiaoxi', Schema);
const yeji = mongoose.model('yeji', Schema);
module.exports = {
  user,
  login,
  salesLead,
  uapp,
  year,
  kehu,
  product,
  kpi,
  client,
  ticket,
  tsb,
  duishou,
  guanhuai,
  qunfa,
  shangji,
  xiaoxi,
  yeji,
};
